package cn.seecoder.courselearning.po.post;

import cn.seecoder.courselearning.vo.post.ReplyVO;

import cn.seecoder.courselearning.dto.post.ReplyDTO;

import java.util.Date;

//对应reply表
public class ReplyPO {
    //回复id
    int replyId;

    //回复的帖子id
    int postId;

    //发表回复的用户id
    int replyUserId;

    //被回复的用户id
    int repliedUserId;

    //回复内容
    String replyContent;

    //被回复的评论的id
    //如果是回复帖子，则是0。
    int repliedId;

    //回复时间
    Date replyTime;

    //该回复是否被用户查看过
    // 0代表没有被查看 1代表查看过了
    int status;

    public ReplyPO() {
    }


    public int getRepliedId() {
        return repliedId;
    }

    public void setRepliedId(int repliedId) {
        this.repliedId = repliedId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getReplyId() {
        return replyId;
    }

    public void setReplyId(int replyId) {
        this.replyId = replyId;
    }


    public int getPostId() {
        return postId;
    }

    public void setPostId(int postId) {
        this.postId = postId;
    }

    public int getReplyUserId() {
        return replyUserId;
    }

    public void setReplyUserId(int replyUserId) {
        this.replyUserId = replyUserId;
    }

    public int getRepliedUserId() {
        return repliedUserId;
    }

    public void setRepliedUserId(int repliedUserId) {
        this.repliedUserId = repliedUserId;
    }

    public String getReplyContent() {
        return replyContent;
    }

    public void setReplyContent(String replyContent) {
        this.replyContent = replyContent;
    }

    public Date getReplyTime() {
        return replyTime;
    }

    public void setReplyTime(Date replyTime) {
        this.replyTime = replyTime;
    }

    public ReplyPO(int replyId, int postId, int replyUserId, int repliedUserId, String replyContent, int repliedId, Date replyTime, int status) {
        this.replyId = replyId;
        this.postId = postId;
        this.replyUserId = replyUserId;
        this.repliedUserId = repliedUserId;
        this.replyContent = replyContent;
        this.repliedId = repliedId;
        this.replyTime = replyTime;
        this.status = status;
    }

    public ReplyPO(ReplyDTO replyDTO){
      replyId=replyDTO.getReplyId();
      postId=replyDTO.getPostId();
      replyUserId=replyDTO.getReplyUserId();
      repliedId=replyDTO.getRepliedId();
      repliedUserId=replyDTO.getRepliedUserId();
      replyContent=replyDTO.getReplyContent();
      replyTime=replyDTO.getReplyTime();
      status=replyDTO.getStatus();
    }

    @Override
    public String toString() {
        return "ReplyPO{" +
                "replyId=" + replyId +
                ", postId=" + postId +
                ", replyUserId=" + replyUserId +
                ", repliedUserId=" + repliedUserId +
                ", replyContent='" + replyContent + '\'' +
                ", repliedId=" + repliedId +
                ", replyTime=" + replyTime +
                ", status=" + status +
                '}';
    }


    public ReplyPO(ReplyVO replyVO) {
        this.replyId = replyVO.getReplyId();
        this.postId = replyVO.getPostId();
        this.replyUserId = replyVO.getReplyUserId();
        this.repliedUserId = replyVO.getRepliedUserId();
        this.replyContent = replyVO.getReplyContent();
        this.repliedId = replyVO.getRepliedId();
        this.replyTime = replyVO.getReplyTime();
        this.status = replyVO.getStatus();
    }

}
